<div style="padding: 15px;">
	<div>
    
  </div>
	<table class="layui-table">
  <colgroup>
  
  </colgroup>
  <thead>
    <tr>
      <th>手机号</th>
      
      <th>级别</th>
      <th>创建时间</th>
       <th>更新时间</th>
     <th>操作</th>
    </tr> 
  </thead>
  <tbody>


  	{foreach :model('User')->Aselect() as $k=>$v}
    <tr>
      <td>{$v.mobile}</td>
     
      <td>{:User::getRole($v.role_id)['role_name']}</td>
       <td>{$v.create_time}</td>
       <td>{if !empty($v.update_time)}{$v.update_time|date='Y-m-d H:i'}{/if}</td>
      <td><a href="/admin/user/edit/{$v.id}"  class="layui-btn layui-btn-xs">修改</a><a id="delete" value={$v.id} class="layui-btn layui-btn-xs layui-btn-danger" >删除</a></td>
    </tr>
   {/foreach}
  </tbody>
</table>
</div>

<script type="text/javascript">
  $('#delete').click(function(){
    if(confirm('确定要删除?') === true){
      var id = $(this).attr('value');
     
      $.get('/admin/user/delete/'+id,function(res){
        console.log(res);
        window.location.href = "/admin/user"
      })
    }else{
      return;
    }
  })
</script>